package net.htjs.juc.chapter07;

import lombok.extern.slf4j.Slf4j;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;

@Slf4j
public class DateTimeFormaterTest {

    /**
     * Exception in thread "Thread-3" Exception in thread "Thread-0" Exception in thread "Thread-2" java.lang.NumberFormatException: multiple points
     * 	at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1890)
     * 	at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
     * 	at java.lang.Double.parseDouble(Double.java:538)
     * 	at java.text.DigitList.getDouble(DigitList.java:169)
     * 	at java.text.DecimalFormat.parse(DecimalFormat.java:2087)
     * 	at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1869)
     * 	at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1514)
     * 	at java.text.DateFormat.parse(DateFormat.java:364)
     * @param args
     */
    public static void main(String[] args) {
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        for(int i = 0; i < 10; i++) {
            new Thread(() -> {
                log.info("{}", dtf.parse("1951-04-21"));
            }).start();
        }
    }
}
